<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
            background-color: black;
        }

        .container {
            width: 300px;
            height: 300px;
            margin: 20px;
        }

        .person {
            position: absolute;
            top: 160px;
            left: 150px;
            animation: runMove 10s infinite  ease-in-out;
        }

        .head {
            position: absolute;
            width: 30px;
            height: 30px;
            border: 6px solid white;
            border-radius: 50%;
            top: -26px;
            left: 5px;
            animation:headMove 2s alternate infinite;
        }

        .torso {
            position: absolute;
            width: 0;
            height: 70px;
            border-left: 6px solid white;
            left: 11px;
            top: 10px;
            transform: rotate(10deg);
        }

        .person .part {
            position: absolute;
            top: 15px;
            left: 0;
        }

        .person .part.arm {
            position: absolute;
            width: 40px;
            height: 45px;
            border-left: 6px solid white;
            border-bottom: 6px solid white;
            left: 15px;
            top: 23px;
            transform-origin: 0% 0% 0px;
            animation:armMove 1s ease-in-out infinite;
        }

        .person .part.arm.one {
            transform: rotate3d(0, 0, 1, 80deg);
        }

        .person .part.arm.two {
            transform: rotate3d(0, 0, 1, -50deg);
            animation-delay: 0.5s;
        }

        .person .part.leg {
            position: absolute;
            width: 50px;
            height: 55px;
            border-right: 6px solid white;
            border-top: 6px solid white;
            left: 11px;
            top: 78px;
            transform-origin: 0% 0% 0px;
            animation:legMove 1s ease-in-out infinite;
        }

        .person .part.leg.one {
            transform: rotate3d(0, 0, 1, 110deg);
        }

        .person .part.leg.two {
            transform: rotate3d(0, 0, 1, 20deg);
            animation-delay: 0.5s;
        }

        /* 头部动画 */
        @keyframes headMove {
            0% {
                transform: rotate3d(0, 0, 1, 5deg);
            }

            25% {
                transform: rotate3d(0, 0, 1, -30deg) skew(15deg, 0deg);
            }

            50% {
                transform: rotate3d(0, 0, 1, 5deg);
            }

            75% {
                transform: rotate3d(0, 0, 1, -30deg) skew(15deg, 0deg);
            }

            100% {
                transform: rotate3d(0, 0, 1, 20deg) skew(-15deg, 0deg);
            }
        }

        /* 手臂动画 */
        @keyframes armMove {
            0% {
                transform: rotate3d(0, 0, 1, 80deg);
            }

            50% {
                transform: rotate3d(0, 0, 1, -60deg);
            }

            100% {
                transform: rotate3d(0, 0, 1, 80deg);
            }
        }

        /* 腿部动画 */
        @keyframes legMove {
            0% {
                transform: rotate3d(0, 0, 1, 120deg);
            }

            50% {
                transform: rotate3d(0, 0, 1, 5deg);
            }

            100% {
                transform: rotate3d(0, 0, 1, 120deg);
            }
        }

        /* 跑步动画 */
        @keyframes runMove {
            0%{
                translate: -235px 0px;
            }
            100%{
                translate: 1450px 0px;
            }
        }

        /* 第二个小人 */
        .container1 {
            position: absolute;
            width: 300px;
            height: 300px;
            margin: 20px;
        }

        .person1 {
            position: absolute;
            top: 160px;
            left: 150px;
            animation: runMove1 15s infinite  linear;
        }

        .person1 .head1 {
            position: absolute;
            width: 30px;
            height: 30px;
            border: 6px solid white;
            border-radius: 50%;
            top: -26px;
            left: 1px;
            animation:headMove1 4s alternate infinite;
        }

        .person1 .torso1 {
            position: absolute;
            width: 0;
            height: 70px;
            border-left: 6px solid white;
            left: 11px;
            top: 10px;
            transform: rotate(5deg);
        }

        .person1 .part1 {
            position: absolute;
            top: 15px;
            left: 0;
        }

        .person1 .part1.arm1 {
            position: absolute;
            width: 40px;
            height: 45px;
            border-left: 6px solid white;
            border-bottom: 6px solid white;
            left: 13px;
            top: 23px;
            transform-origin: 0% 0% 0px;
            animation:armMove1 2s ease-in-out infinite;
        }

        .person1 .part1.arm1.one1 {
            transform: rotate3d(0, 0, 1, 70deg);
        }

        .person1 .part1.arm1.two1 {
            transform: rotate3d(0, 0, 1, -40deg);
            animation-delay: 1s;
        }

        .person1 .part1.leg1 {
            position: absolute;
            width: 50px;
            height: 55px;
            border-right: 6px solid white;
            border-top: 6px solid white;
            left: 13px;
            top: 78px;
            transform-origin: 0% 0% 0px;
            animation:legMove1 2s ease-in-out infinite;
        }

        .person1 .part1.leg1.one1 {
            transform: rotate3d(0, 0, 1, 100deg);
        }

        .person1 .part1.leg1.two1 {
            transform: rotate3d(0, 0, 1, 10deg);
            animation-delay: 1s;
        }

        /* 头部动画 */
        @keyframes headMove1 {
            0% {
                transform: rotate3d(0, 0, 1, 5deg);
            }

            25% {
                transform: rotate3d(0, 0, 1, -30deg) skew(15deg, 0deg);
            }

            50% {
                transform: rotate3d(0, 0, 1, 5deg);
            }

            75% {
                transform: rotate3d(0, 0, 1, -30deg) skew(15deg, 0deg);
            }

            100% {
                transform: rotate3d(0, 0, 1, 20deg) skew(-15deg, 0deg);
            }
        }

        /* 手臂动画 */
        @keyframes armMove1 {
            0% {
                transform: rotate3d(0, 0, 1, 60deg);
            }

            50% {
                transform: rotate3d(0, 0, 1, -40deg);
            }

            100% {
                transform: rotate3d(0, 0, 1, 60deg);
            }
        }

        /* 腿部动画 */
        @keyframes legMove1 {
            0% {
                transform: rotate3d(0, 0, 1, 110deg);
            }

            50% {
                transform: rotate3d(0, 0, 1, 25deg);
            }

            100% {
                transform: rotate3d(0, 0, 1, 110deg);
            }
        }

        /* 跑步动画 */
        @keyframes runMove1 {
            0%{
                translate: -320px 0px;
            }
            100%{
                translate: 1400px 0px;
            }
        }
    </style>
</head>

<body>

    <!-- 火柴人的结构 -->
    <div class="container">
        <div class="person">
            <div class="head"></div>
            <div class="part arm one"></div>
            <div class="part arm two"></div>
            <div class="torso"></div>
            <div class="part leg one"></div>
            <div class="part leg two"></div>
        </div>
    </div>

    <div class="container1">
        <div class="person1">
            <div class="head1"></div>
            <div class="part1 arm1 one1"></div>
            <div class="part1 arm1 two1"></div>
            <div class="torso1"></div>
            <div class="part1 leg1 one1"></div>
            <div class="part1 leg1 two1"></div>
        </div>
    </div>

</body>

</html>